package ru.ifmo.cppsc.lexer.token;

/**
 * Lexical primitive unit
 *
 * @author Oleg Rybak
 */
public class Token {

    /**
     * String value of the token
     */
    private final String value;

    /**
     * Type of the token
     */
    private final TokenType type;

    /**
     * Index in the identifier list
     */
    private final int index;

    /**
     * Line number in the input file
     */
    private final int lineNumber;

    private final String symbol;

    private Token varType;
    private Token varId;


    public Token(TokenType type, int index, String value, int lineNumber, String symbol, Token varType, Token varId) {
        this.type = type;
        this.value = value;
        this.index = index;
        this.lineNumber = lineNumber;
        this.symbol = symbol;
        this.varType = varType;
        this.varId = varId;
    }

    public String getValue() {
        return value;
    }

    public TokenType getType() {
        return type;
    }

    public int getIndex() {
        return index;
    }

    public int getLineNumber() {
        return lineNumber;
    }

    public String getSymbol() {
        return symbol;
    }

    public Token getVarType() {
        return varType;
    }

    public Token getVarId() {
        return varId;
    }
}
